package com.guaoran.other.stategy.pay.bean;


import com.guaoran.other.stategy.pay.interfaces.Payment;

/**
 * 订单
 */
public class Order {
    private String uid;
    private String orderId;
    private double amount;

    public Order(String uid,String orderId,double amount){
        this.uid = uid;
        this.orderId = orderId;
        this.amount = amount;
    }
    //支付 ，根据传入的对象，进行调用传入对象的方法
    public PayState pay(Payment payment){
        return payment.pay(this.uid,this.amount);
    }
    public PayState payStategy(PayType payType){
        System.out.println("使用策略模式封装支付方式");
        return payType.get().pay(uid,amount);
    }

}
